﻿@using Jugg.Admin.Framework.Mvc.Html
@model Jugg.Mapping.SysUser.SysUserMapping
@{
    ViewBag.Title = "编辑系统用户";
}
<div class="breadcrumbs" id="breadcrumbs">
    <ul class="breadcrumb">
        <li>
            <i class="ace-icon fa fa-home home-icon"></i>
            <a href="@Url.RouteUrl("homeIndex")">首页</a>
        </li>
        <li><a href="@ViewBag.ReturnUrl">用户列表</a></li>
        <li class="active">@ViewBag.Title</li>
    </ul>
</div>
<div class="page-content">
    <div class="page-header">
        <h1>
            @ViewBag.Title
        </h1>
    </div>
    <div class="row">
        <div class="col-sm-12">
            @using (Html.BeginRouteForm("editUser", new { returnUrl = ViewBag.ReturnUrl }, FormMethod.Post, new { @class = "form-horizontal" }))
            {
                @Html.HiddenFor(m => m.Id)
                @Html.AntiForgeryToken()
                if (Model.Id == Guid.Empty)
                {
                    <div class="form-group">
                        <label class="col-sm-2 control-label no-padding-right">账号 @Html.RequiredSpan()</label>
                        <div class="col-sm-9">
                            @Html.TextBoxFor(m => m.Account, new { @class = "col-xs-10 col-sm-5", placeholder = "用户账号" })
                            @Html.ValidationMessageFor(m => m.Account)
                        </div>
                    </div>
                }
                else
                {
                    <div class="form-group">
                        <label class="col-sm-2 control-label no-padding-right">账号</label>
                        <div class="col-sm-9">
                            @Html.HiddenFor(m => m.Account)
                            <b>@Model.Account</b>
                        </div>
                    </div>
                }
                <div class="form-group">
                    <label class="col-sm-2 control-label no-padding-right">姓名 @Html.RequiredSpan()</label>
                    <div class="col-sm-9">
                        @Html.TextBoxFor(m => m.Name, new { @class = "col-xs-10 col-sm-5", placeholder = "姓名" })
                        @Html.ValidationMessageFor(m => m.Name)
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label no-padding-right">手机号码</label>
                    <div class="col-sm-9">
                        @Html.TextBoxFor(m => m.MobilePhone, new { @class = "col-xs-10 col-sm-5", placeholder = "手机号码" })
                        @Html.ValidationMessageFor(m => m.MobilePhone)
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label no-padding-right">邮箱地址</label>
                    <div class="col-sm-9">
                        @Html.TextBoxFor(m => m.Email, new { @class = "col-xs-10 col-sm-5", placeholder = "邮箱地址" })
                        @Html.ValidationMessageFor(m => m.Email)
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-sm-2 control-label no-padding-right">性别</label>
                    <div class="radio">
                        <label>
                            @Html.RadioButtonFor(m => m.Sex, "男", new { @class = "ace", id = "sex1" })
                            <span class="lbl"> 男</span>
                        </label>
                        <label>
                            @Html.RadioButtonFor(m => m.Sex, "女", new { @class = "ace", id = "sex2" })
                            <span class="lbl"> 女</span>
                        </label>
                    </div>
                </div>
                <div class="col-md-offset-2 col-md-9">
                    <button class="btn btn-info" type="submit">
                        <i class="ace-icon fa fa-check bigger-110"></i>
                        提交
                    </button>
                </div>
            }
        </div>
    </div> 
</div>